<template>
    <div>
        <!-- 表格表头 -->
        <div class="table-header">
            <div>
                <!-- <el-button-group>
                    <el-button icon="el-icon-circle-plus-outline" size="small"
                        @click="selectUserDailog(userRoleForm.roleId)">关联用户</el-button>
                    <el-button icon="el-icon-remove-outline" size="small" @click="deleteHandle()">删除用户</el-button>
                </el-button-group> -->
            </div>
            <div>
                <el-button size="small" round icon="el-icon-refresh" @click="getDataList()"></el-button>
            </div>
        </div>

        <el-table :data="tableDataList" size="small" min-height="300" style="width: 100%"  highlight-current-row
            @selection-change="handleSelectionChange">
            <!-- <el-table-column type="selection" header-align="center" align="center" width="50">
            </el-table-column> -->
            <el-table-column property="roleId" label="角色编号"></el-table-column>
            <el-table-column property="roleName" label="角色名称"></el-table-column>
            <el-table-column property="roleDescription" label="角色描述"></el-table-column>
            <el-table-column property="roleStatusDesc" label="角色描述"></el-table-column>
            <el-table-column property="roleTypeDesc" label="角色描述"></el-table-column>
            <el-table-column property="createdBy" label="指派人"></el-table-column>
            <el-table-column property="createdTime" label="指派时间"></el-table-column>

            <div slot="empty">
                <div class="avue-empty">
                    <div class="avue-empty__image" style="height: 50px;"><img
                            src=""
                            alt=""></div>
                    <p class="avue-empty__desc">暂无数据</p>
                </div>
            </div>
        </el-table>

    </div>

</template>
<script>
    import * as userRoleService from '@/api/upms/userrole'
    import * as orgService  from '@/api/upms/org'

    import * as responsibilityService from '@/api/upms/responsibility'
    export default {
        data() {
            return {
                dataForm:{
                    pkResponsibility: ''
                },
                tableDataList: [],
            }
        },
        components: {
        },
        methods: {
            init(pkResponsibility) {
                if (pkResponsibility) {
                    this.dataForm.pkResponsibility = pkResponsibility;
                    this.getDataList()
                }
            },
            // 默认加载用户角色授权列表
            getDataList() {
                responsibilityService.getRoleByPkResp(this.dataForm.pkResponsibility).then(data => {
                    this.tableDataList = data
                })
            },
            //多选
            handleSelectionChange(val) {
                this.multipleSelection = val;
            },
        }
    }
</script>